# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=pw-volume
pkgver=0.2.0
pkgrel=0
pkgdesc="Basic interface to PipeWire volume controls"
url="https://github.com/smasher164/pw-volume"
arch="aarch64 armhf armv7 ppc64le x86 x86_64"  # limited by rust/cargo
license="MIT"
depends="cmd:pw-cli cmd:pw-dump"
makedepends="cargo"
source="https://github.com/smasher164/pw-volume/archive/v$pkgver/pw-volume-$pkgver.tar.gz"
options="!check"  # no tests provided

export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
export CARGO_PROFILE_RELEASE_LTO="true"
export CARGO_PROFILE_RELEASE_OPT_LEVEL="z"
export CARGO_PROFILE_RELEASE_PANIC="abort"

prepare() {
	default_prepare

	cargo fetch --locked
}

build() {
	cargo build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -D -m755 target/release/pw-volume -t "$pkgdir"/usr/bin/
}

sha512sums="
0b78fb73937ff3bf4511c9be1db3e69f3f8984f89301a128a396443980f719c0cbb5df80d6268611042df743f197a6780af9c00d3a2bd9d8798dbd5ac2b093bb  pw-volume-0.2.0.tar.gz
"
